package 笔试强训;
import java.util.*;
public class Text1 {
    //题目 : 笔试强训day34第一题  ISBN号码
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.next();
        char[] cs = str.toCharArray();
        int sum = 0;
        int k  = 1;
        int n = cs.length;
        for(int i = 0; i < n-2; i++) {
            if(cs[i] != '-') {
                sum += (cs[i]-'0') * k;
                k++;
            }
        }

        int val = sum % 11;
        String str1 = (cs[n-1] == 'X'? "10" : String.valueOf(cs[n-1]-'0'));
        if(String.valueOf(val).equals(str1)) {
            System.out.println("Right");
        }else {
            for(int i = 0; i < n-1; i++) {
                System.out.print(cs[i]);
            }
            System.out.println(val == 10? "X" :val);
        }
    }
}
